clear all
set more off
capture log close
pause on

* This .do file starts with the file attachment sent on Aug 15 2021.  SC altered the top row manually to create some variable names in the .csv

/* SC */ cd "/Users/robertchaudoin/Dropbox/Complementarity ZC/Survey_ISR/ISR data/"
/* KZ */ capture use "/Users/kelebogilezvobgo/Dropbox/Complementarity/", clear

import delimited using "21012502 Havard IL 15082021 varnames.csv", clear



drop if status != "Complete"

* QQQ is an internal marker for practice runs of the survey; not an actual respondent if their ID contains "QQQ"
drop if strpos(sguidrmsid, "QQQ")

*** Treatment indicator
gen treatment = 0
replace treatment = 1 if strpos(recap, "can only")

*** Outcome measures variable construction
* The "_nn" versions stand for "no neither agree/disagree answers."  Those respondents are coded as missing for this version.

* Support for an ICC investigation
gen iccsupport_bin = 0
replace iccsupport_bin = 1 if iccinvsupport == "Somewhat agree" | iccinvsupport == "Strongly agree"

gen iccsupport_bin_nn = 0
replace iccsupport_bin_nn = 1 if iccinvsupport == "Somewhat agree" | iccinvsupport == "Strongly agree"
replace iccsupport_bin_nn = . if iccinvsupport == "Neither agree nor disagree"

gen iccsupport_num = .
replace iccsupport_num = 0 if iccinvsupport == "Strongly disagree"
replace iccsupport_num = 1 if iccinvsupport == "Somewhat disagree"
replace iccsupport_num = 2 if iccinvsupport == "Neither agree nor disagree"
replace iccsupport_num = 3 if iccinvsupport == "Somewhat agree"
replace iccsupport_num = 4 if iccinvsupport == "Strongly agree"


* Support for a domestic investigation in the target country
gen countryinvsupport_bin = 0
replace countryinvsupport_bin = 1 if countryinvsupport == "Somewhat agree" | countryinvsupport == "Strongly agree"

gen countryinvsupport_bin_nn = 0
replace countryinvsupport_bin_nn = 1 if countryinvsupport == "Somewhat agree" | countryinvsupport == "Strongly agree"
replace countryinvsupport_bin_nn = . if countryinvsupport == "Neither agree nor disagree"

gen countryinvsupport_num = .
replace countryinvsupport_num = 0 if countryinvsupport == "Strongly disagree"
replace countryinvsupport_num = 1 if countryinvsupport == "Somewhat disagree"
replace countryinvsupport_num = 2 if countryinvsupport == "Neither agree nor disagree"
replace countryinvsupport_num = 3 if countryinvsupport == "Somewhat agree"
replace countryinvsupport_num = 4 if countryinvsupport == "Strongly agree"


* ICC bias
gen iccbiased_bin = 0
replace iccbiased_bin = 1 if iccbiased == "Somewhat agree" | iccbiased == "Strongly agree"

gen iccbiased_bin_nn = 0
replace iccbiased_bin_nn = 1 if iccbiased == "Somewhat agree" | iccbiased == "Strongly agree"
replace iccbiased_bin_nn = . if iccbiased == "Neither agree nor disagree"

gen iccbiased_num = .
replace iccbiased_num = 0 if iccbiased == "Strongly disagree"
replace iccbiased_num = 1 if iccbiased == "Somewhat disagree"
replace iccbiased_num = 2 if iccbiased == "Neither agree nor disagree"
replace iccbiased_num = 3 if iccbiased == "Somewhat agree"
replace iccbiased_num = 4 if iccbiased == "Strongly agree"


* Support for ISR joining the ICC
gen isrjoin_bin = 0
replace isrjoin_bin = 1 if joinicc == "Somewhat agree" | joinicc == "Strongly agree"

gen isrjoin_bin_nn = 0
replace isrjoin_bin_nn = 1 if joinicc == "Somewhat agree" | joinicc == "Strongly agree"
replace isrjoin_bin_nn = . if joinicc == "Neither agree nor disagree"

gen iccjoin_num = .
replace iccjoin_num = 0 if joinicc == "Strongly disagree"
replace iccjoin_num = 1 if joinicc == "Somewhat disagree"
replace iccjoin_num = 2 if joinicc == "Neither agree nor disagree"
replace iccjoin_num = 3 if joinicc == "Somewhat agree"
replace iccjoin_num = 4 if joinicc == "Strongly agree"



* Support for stopping settlements
gen settlements_bin = 0
replace settlements_bin = 1 if settlements == "Somewhat agree" | settlements == "Strongly agree"

gen settlements_bin_nn = 0
replace settlements_bin_nn = 1 if settlements == "Somewhat agree" | settlements == "Strongly agree"
replace settlements_bin_nn = . if settlements == "Neither agree nor disagree"

gen settlements_num = .
replace settlements_num = 0 if settlements == "Strongly disagree"
replace settlements_num = 1 if settlements == "Somewhat disagree"
replace settlements_num = 2 if settlements == "Neither agree nor disagree"
replace settlements_num = 3 if settlements == "Somewhat agree"
replace settlements_num = 4 if settlements == "Strongly agree"



*** Israeli Legal system
gen isrlegsyscapable_bin = 0
replace isrlegsyscapable_bin = 1 if isrlegalsystem == "Somewhat agree" | isrlegalsystem == "Strongly agree"

gen isrlegsyscapable_bin_nn = 0
replace isrlegsyscapable_bin_nn = 1 if isrlegalsystem == "Somewhat agree" | isrlegalsystem == "Strongly agree"
replace isrlegsyscapable_bin_nn = . if isrlegalsystem == "Neither agree nor disagree"

*** Netanyahu approval
gen appnetanyahu_bin = 0
replace appnetanyahu_bin = 1 if appnetanyahu == "Somewhat approve" | appnetanyahu == "Strongly approve"

gen appnetanyahu_bin_nn = 0
replace appnetanyahu_bin_nn = 1 if appnetanyahu == "Somewhat approve" | appnetanyahu == "Strongly approve"
replace appnetanyahu_bin_nn = . if appnetanyahu == "Neither approve nor disapprove"



***
* Respondent characteristics setup
***

*** Female
gen female = 0
replace female = 1 if gender == "Female"



*** Religion
* Making a Jewish indicator (90% of the sample)
gen jewish = 0
replace jewish = 1 if strpos(religion1, "Jewish")


*** Language
* 80% took it in Hebrew


*** Education
* . table education, stubwidth(40)
*I am post-secondary graduated (e g , voc |      1,070 * I am post-secondary graduated (e g , vocational certuficate, Bachelors degree, Masters degree, Doctorate)
*I attendend post-secondary school but I  |        385
*              I have no formal education |         11
*         I only completed primary school |         11
*       I only completed secondary school |        542
gen education_postsec = 0
replace education_postsec = 1 if  strpos(education, "I am")

*** Income
* Constructed indicators for 0-25th percentiles, 26-75, and 76+
gen income_lower25th = 0
gen income_26thto75th = 0
gen income_above75th = 0

replace income_lower25th = 1 if income <= 8000
replace income_26thto75th = 1 if income > 8000 & income <= 20000
replace income_above75th = 1 if income > 20000

*** Left/right political scale
* Higher numbers mean more right

*** Newshours
* Median is 4
gen newshours_morethan4 = 0
replace newshours_morethan4 = 1 if newshours > 4

*** Marital status
* Note that this variable is missing for a bunch of respondents, because of a survey programming 
gen married = 0
replace married = 1 if marital == "Married"
replace married = . if marital == ""

*** Region
* There are 6 regions coded



***
* Other variables
***

*** Manipulation check variable construction
* Substrings from correct answers: "That country already"... // "The ICC cannot"...
gen manip1_correct = 0
replace manip1_correct = 1 if strpos(manipcheck1, "That country already")

gen manip2_correct = 0
replace manip2_correct = 1 if strpos(manipcheck2, "The ICC cannot")
 
gen complier1 = 0
gen complier2 = 0
gen complier1and2 = 0

replace complier1 = 1 if treatment == 1 & manip1_correct == 1
replace complier1 = 1 if treatment == 0

replace complier2 = 1 if treatment == 1 & manip2_correct == 1
replace complier2 = 1 if treatment == 0

replace complier1and2 = 1 if treatment == 1 & manip1_correct == 1 & manip2_correct == 1
replace complier1and2 = 1 if treatment == 0
	* In the USA survey, I labelled these "cchec" for "comprehension check."
 
 
 
export delimited using "ISR_processed_2021_08_16.csv", replace
 
 

 
***
* Descriptive stats and balance
***
global ctrls female age education_postsec income_lower25th income_26thto75th income_above75th leftright jewish newshours_morethan4
global dvs iccsupport_bin countryinvsupport_bin iccbiased_bin isrjoin_bin settlements_bin

estpost su treatment $dvs $ctrls
	est store full
estpost su treatment $dvs $ctrls if treatment == 1
	est store compl
estpost su treatment $dvs $ctrls if treatment == 0
	est store ctrl

*	Making summary stats table, means only, full - treatment only - control only
	esttab full compl ctrl ///
		using "/Users/robertchaudoin/Dropbox/Complementarity ZC/Survey_ISR/meanstats_tmtctrl_labelled_isr.tex", replace ///
		cells(mean(fmt(2))) nodep nonum  ///
		mtitle("Full" "Treatment" "Control") ///
		coeflabels(treatment "Compl. Treatment" ///
		iccsupport_bin "Support ICC Inv." countryinvsupport_bin "Support ISR Inv." iccbiased_bin "ICC is biased" isrjoin_bin "Support ICC Memb" settlements_bin "Stop Settlements" ///
		female "Female" age "Age" education_postsec "Post-Sec. Educ." income_lower25th "Income < 25th percentile" income_26thto75th "Income 26-75th percentile" income_above75th "Income > 75th percentile" leftright "Left/Right scale" jewish "Jewish" newshours_morethan4 "News hours per week (>4)")


 

